#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll t;
void solve(){
	ll n;
	cin>>n;
	vector<ll> ve(n+1,0);
	ll ret=0;
	ll ling=0;
	for (int i=1;i<=n;i++){
		cin>>ve[i];
		ret+=ve[i];
		if (ve[i]==0)ling++;
	}
	cout<<ret+ling<<endl;
}
int main(){
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	
	cin>>t;
	while(t--){
		solve();
	} 
	return 0;
}  
